package bio;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Client {

    public static void main(String[] args) throws Exception{

            Scanner in=new Scanner(System.in);
            Socket socket=new Socket("127.0.0.1",8080);
            OutputStream os=socket.getOutputStream();
            new Thread(()->{
                while (true){
                    String info=in.nextLine();
                    try {
                        os.write(info.getBytes());
                        os.flush();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }).start();


    }
}
